package com.shyroke.util;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public class CalculationUtil {
	
	/**
	 * 
	 * @return key代表第几个专家，value代表T,I,F的List集合
	 * @throws IOException
	 */
		public Map<String,List<Double>> getExpertImportance() throws IOException {
			Map<String,List<Double>> map = new HashMap<>();
			Properties prop = new Properties();  
			prop.load(this.getClass().getResourceAsStream("/expertImportance.properties"));  
			
			List<Double> valueList1 = new ArrayList<>();
			valueList1.add(Double.valueOf(prop.getProperty("expert1T")));
			valueList1.add(Double.valueOf(prop.getProperty("expert1I")));
			valueList1.add(Double.valueOf(prop.getProperty("expert1F")));
			map.put("1", valueList1);
			
			List<Double> valueList2 = new ArrayList<>();
			valueList2.add(Double.valueOf(prop.getProperty("expert2T")));
			valueList2.add(Double.valueOf(prop.getProperty("expert2I")));
			valueList2.add(Double.valueOf(prop.getProperty("expert2F")));
			map.put("2", valueList2);
			
			List<Double> valueList3 = new ArrayList<>();
			valueList3.add(Double.valueOf(prop.getProperty("expert3T")));
			valueList3.add(Double.valueOf(prop.getProperty("expert3I")));
			valueList3.add(Double.valueOf(prop.getProperty("expert3F")));
			map.put("3", valueList3);
			
			List<Double> valueList4 = new ArrayList<>();
			valueList4.add(Double.valueOf(prop.getProperty("expert4T")));
			valueList4.add(Double.valueOf(prop.getProperty("expert4I")));
			valueList4.add(Double.valueOf(prop.getProperty("expert4F")));
			map.put("4", valueList4);
			
			return map;
		}
		
	
}
